import 'vx-easyui/dist/themes/default/easyui.css';
import 'vx-easyui/dist/themes/icon.css';
import 'vx-easyui/dist/themes/vue.css';
import VxEasyUI from 'vx-easyui';
import locale from 'vx-easyui/dist/locale/easyui-lang-zh_CN'

const req = require.context('vx-easyui/dist/locale', false, /\.js$/)
// 这个的多语言就是也是修改 window.Locale.use(locale) use那个就是用的语法
// 自己包装一下
VxEasyUI.useLang = (name) => {
  window.Locale.use(req(`./easyui-lang-${name}.js`).default)
}
VxEasyUI.getAllLangName = () => {
  return req.keys().filter(i => {
    if (i.startsWith('./easyui-lang-')) {
      return true
    }
    return false
  }).map(i => {
    return i.replace('./easyui-lang-', '').replace('.js', '')
  })
}
Vue.use(VxEasyUI, {
  locale: locale
});
export default VxEasyUI

